<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">
      
	<h:head>
		<h:outputStylesheet name="estilos.css" library="css"/>
	</h:head>
	<h:body>
		<div id="container">	
				<div id="header-capa">									
					<img src="../resources/imagens/logo-bola.png" alt="Bola na Rede" /><br />
					<font class="texto2">
					O seu site para marcar aquela pelada com os amigos!
					</font>
				</div>	
				<div id="mainnav-capa">
					<h:form id="acesso" rendered="#{validacaoUsuarioBean.verificarSessao() eq false}">
						<p:focus context="acesso"></p:focus>
						<h:messages styleClass="texto1"/>
						<h:panelGrid columns="2">							
							<h:outputLabel value="Usuário" styleClass="texto1"/>							
							<h:inputText id="email" value="#{validacaoUsuarioBean.usuarioSelecionado.email}" required="true" requiredMessage="Digite o seu email" size="30" validatorMessage="Email inválido" >
								<f:validateRegex
		pattern="^[_A-Za-z0-9-\+]+(\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\.[A-Za-z0-9]+)*(\.[A-Za-z]{2,})$" />
							</h:inputText>							
							<h:outputLabel value="Senha" styleClass="texto1"/>							
							<h:inputSecret id="senha" value="#{validacaoUsuarioBean.usuarioSelecionado.senha}" required="true" requiredMessage="Digite a sua senha" size="30"/>							
							<h:commandButton action="#{validacaoUsuarioBean.verificarDados()}" value="Acessar" styleClass="botoes2"/> 
							<h:commandButton value="Primeiro acesso?" action="novoUsuario" styleClass="botoes2" immediate="true"/>							
						</h:panelGrid>
						<p/>
						<h:commandLink action="novaSenhaUsuario"  value="Esqueci minha senha" immediate="true" styleClass="texto1"/>
					</h:form>
					<h:form id="logado" rendered="#{validacaoUsuarioBean.verificarSessao() eq true}">
						<font class="texto1">Você está logado <h:commandLink value="#{validacaoUsuarioBean.retornarUsuario().nome}" action="paginaInicial" styleClass="texto3"/> !</font>
						 - <h:commandLink value="Sair" action="#{validacaoUsuarioBean.encerrarSessao()}" />
					</h:form>					
		</div>	</div>	
	</h:body>
</html>